<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>微信支付</title>
    <style type="text/css">
        body{
            font-family: "Microsoft YaHei";
        }
        .pay-box{
            position: absolute;
            top: 50%;
            margin-top: -516px;
            left: 50%;
            margin-left: -320px;
        }
        .ico{
            width: 240px;
            height: 240px;
            border-radius: 120px;
            background: #3FB837;
            color: #fff;
            display: inline-block;
            font-size: 160px;
            line-height: 240px;
        }
        .txt{
            font-size: 42px;
            padding-top: 30px;
            color: #333;
        }
        .val{
            font-size: 80px;
            font-weight: bold;
        }
        .pay{
            width: 640px;
            height: 100px;
            margin-top: 100px;
            padding: 20px;
            border-radius: 10px;
            font-size:42px;
            color: #fff;
            background: #07BF05;
            border: 0px;
            text-align: center;
        }
        a{
            color: #fff;
            background: transparent !important;
        }
    </style>
</head>
<body>
<div class="pay-box" style="text-align: center;">
    <div class="ico">
        ￥
    </div>
    <div class="txt">
        支付金额
    </div>
    <div class="val">
        ￥<span></span>
        <!-- 这里使用原生PHP echo输出需要支付的价格 -->
    </div>
    <a class="pay" href="#"><button>确认支付</button></a>
    <!-- 这里点击调起微信支付页面 mweb_url  -->
</div>

<script src="__PUBLIC__/layui/layui.js" charset="utf-8"></script>
<script src="__PUBLIC__/jquery/jquery.min.js"></script>

<script type="text/javascript">
    layui.use('layer', function(){
        var layer = layui.layer;
        // $('.pay').click(function () {
            $.post("{:url('goods/ceshi2')}",{},function (data) {
                var dat= JSON.parse(data)
                console.log(dat.result);
                // console.log(data);
                $('.pay').attr('href',dat.result);

                // window.location.href=dat.result

            // })

        })
    });

</script>



</body>
</html>

